import request from "@/utils/request";
import store from "@/store";

// 查询数据
export function getDataListApi(params) {
  return request({
    url: '/erp/employee/list',
    method: 'GET',
    params: {
      ...params,
      userId: store.state.user.id,
      deptId: store.state.user.deptId,
    }
  })
}

// 增加数据
export function addDataApi(data) {
  return request({
    url: '/erp/employee/add',
    method: 'POST',
    data: {
      ...data,
      deptId: store.state.user.deptId,
    }
  })
}

// 修改数据
export function updateDataApi(data) {
  return request({
    url: '/erp/employee/update',
    method: 'PUT',
    data
  })
}

// 删除数据
export function deleteDataApi(data) {
  return request({
    url: '/erp/employee/delete/' + data.id,
    method: 'DELETE',
    // data
  })
}
